<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script>
  function unique(arr) {
    var newArr = [];
    for(var i = 0; i < arr.length; i++){
      if(newArr.indexOf(arr[i]) === -1){
        newArr.push(arr[i])
      }
    }
    return newArr;
  }

  console.log(unique([1, 2, 1, 2, 3, 4, 5, 6, 7, 1]));
</script>
</html>